PROG = ping_pong
CFLAGS = -g -fPIC -m64 -Wall
LFLAGS= -fPIC -m64 -Wall
CC = mpicc

all: $(PROG)

ping_pong.o: ping_pong.c
	$(CC) $(CFLAGS) -c ping_pong.c

ping_pong : ping_pong.o
	$(CC) $(LFLAGS) ping_pong.o -o ping_pong
	
run :
	mpiexec --hostfile hostfile -np 2 ping_pong

clean:
	/bin/rm -f *~
	/bin/rm -f *.o
	/bin/rm -rf ping_pong